/**
 * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// Autogenerated file -- DO NOT EDIT!
% Compiler::intrinsics.each do |intrinsic|
  {
    constexpr auto clear_flags = <%= intrinsic.clear_flags.empty? ? "0U" : intrinsic.clear_flags.collect { |f| "compiler::inst_flags::" + f.upcase }.join("|") %>;
    constexpr auto set_flags = <%= intrinsic.set_flags.empty? ? "0U" : intrinsic.set_flags.collect { |f| "compiler::inst_flags::" + f.upcase }.join("|") %>;
    auto inst= Inst::New<IntrinsicInst>(&allocator, Opcode::Intrinsic);
    inst->ClearFlag(static_cast<inst_flags::Flags>(set_flags));
    inst->SetFlag(static_cast<inst_flags::Flags>(clear_flags));
    // expected flags after inverse flags adjustment
    auto expected_flags = inst_flags::NO_DCE | inst_flags::NO_CSE | inst_flags::NO_HOIST | inst_flags::BARRIER | inst_flags::REQUIRE_STATE | inst_flags::RUNTIME_CALL;
    ASSERT_EQ(expected_flags, inst->GetFlagsMask()) << "Fix <%= intrinsic.enum_name %> intrinsic flags";
  }
% end
